Skip to content

feat: parse PostgreSQL metadata object DDL - #2931

Merged
manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:feat/postgresql-metadata-object-ddl-20261115
Nov 15, 2026
Merged

manticore-projects merged 1 commit into
JSQLParser:masterfrom
minleejae:feat/postgresql-metadata-object-ddl-20261115

Conversation

@minleejae

@minleejae minleejae commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

PostgreSQL language, large-object ownership and several text-search DDL commands
were returned as UnsupportedStatement. Add typed statement models for:

  • CREATE [OR REPLACE] [TRUSTED] [PROCEDURAL] LANGUAGE, with HANDLER, INLINE,
    VALIDATOR/NO VALIDATOR and the handlerless form; ALTER [PROCEDURAL] LANGUAGE
    RENAME/OWNER.
  • ALTER LARGE OBJECT ... OWNER TO, with a numeric OID expression.
  • CREATE/ALTER TEXT SEARCH DICTIONARY, PARSER and TEMPLATE. Preserve ordered options
    using the existing DefinitionElement/DefinitionArgument model, including quoted
    keys, string/number values, qualified function names and dictionary option removal.

Wire the new types into statement visitors, deparsing, feature analysis
(MODIFIES_SCHEMA), table discovery and validation capabilities. The OID expression
participates in expression traversal and custom deparsing. Parser/template ALTER
models expose rename/schema changes; dictionary ALTER also supports ownership and
option changes. Repeated definitions retain their order; convenience getters expose the last value,
matching PostgreSQL. No new reserved keywords are introduced.

References: PostgreSQL CREATE LANGUAGE,
ALTER LARGE OBJECT,
DICTIONARY,
PARSER,
TEMPLATE.

Validation:

  • All eleven original typed-AST regression cases fail on master f880f35.
  • JDK 17 ./gradlew check jar: PASS; 16,563 tests, zero failures/errors,
    25 existing skips. New metadata regression class: 98/98 PASS. Initial clean
    generation, grammar ambiguity, Checkstyle, PMD, SpotBugs, Spotless and coverage
    verification all pass. An external init script caps heaps and pins the formatter
    ratchet to f880f35 without changing repository build configuration.
  • GitHub CI on c4ca98d: full Gradle Check passes on Linux, macOS and Windows;
    grammar ambiguity and Codacy pass. Maven Verify passes on Linux; the Windows/macOS jobs are still running.
  • Twenty-six SQL cases parse, deparse and reparse in default and PostgreSQL modes.
    All twenty-six deparser outputs execute successfully on PostgreSQL 18.6 with
    synthetic fixtures, transaction rollback and catalog postchecks.
  • The SQL survey covers 80 DDL cases and two adjacent probes (164 default/explicit
    observations). It preserves every previously parsed observation and changes the targeted unsupported commands into
    their concrete statement types.

Known limit: binary/octal OID literals (0b/0o prefixes) still need shared lexer
support. The existing decimal and hexadecimal tokens are reused without changing the shared lexer.

AI assistance: prepared with OpenAI Codex.

Add typed language, large-object ownership and text-search metadata
statements with visitor, deparser and validation integration. Reuse
structured definition arguments and preserve ordered duplicate options
with last-value accessors matching PostgreSQL.

Cover syntax variants, rejected forms, statement boundaries, AST fields,
OID traversal and existing unsupported-statement fallback behavior.
@manticore-projects
manticore-projects merged commit 8728fc5 into JSQLParser:master Nov 15, 2026
10 checks passed
@manticore-projects

Copy link
Copy Markdown
Contributor

thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants